home *** CD-ROM | disk | FTP | other *** search
/ The Arsenal Files 8 / The Arsenal Files Collection #8 (Arsenal Computer) (1996).ISO / dosutils / tsbat50.zip / SHOW.BAT < prev    next >
DOS Batch File  |  1992-08-29  |  2KB  |  60 lines

  1. echo off
  2. rem The first nine lines constitute a subroutine which SHOW.BAT needs
  3. rem Thus a second batch file is not needed since SHOW.BAT calls itself
  4. rem The subroutine displays a single file
  5. if not "%2"=="recurse" goto _begin
  6. echo File %1
  7. type %1 | more
  8. echo Strike a key for the next file . . .
  9. pause > nul
  10. goto _out
  11.  
  12. :_begin
  13. echo.
  14. echo ┌─────────────────────────────────────────────────────┐
  15. echo │ Type multiple files and allow wildcarded file names │
  16. echo │ By Prof. Timo Salmi, ts@uwasa.fi, Sat 29-Aug-1992   │
  17. echo └─────────────────────────────────────────────────────┘
  18. echo.
  19.  
  20. rem If no parameters then give the instructions
  21. if "%1"=="" goto _help
  22.  
  23. rem Check that show.bat is available at path or current directory
  24. set _found=no
  25. if exist show.bat set _found=yes
  26. for %%d in (%path%) do if exist %%d\show.bat set _found=yes
  27. for %%d in (%path%) do if exist %%dshow.bat set _found=yes
  28. if "%_found%"=="no" goto _no_show
  29.  
  30. rem Type the files
  31. :_loop
  32. if not exist %1 goto _err
  33. for %%f in (%1) do %comspec% /e:1024 /c show %%f recurse
  34. shift
  35. if not "%1"=="" goto _loop
  36. goto _out
  37.  
  38. rem Warn if file not found, then try the next
  39. :_err
  40. echo File(s) %1 not found
  41. shift
  42. if not "%1"=="" goto _loop
  43. goto _out
  44.  
  45. :_no_show
  46. echo You must have show.bat at your path (or the current directory)
  47. goto _out
  48.  
  49. rem The instructions "(if everything else fails, then rtfm :-)"
  50. :_help
  51. echo Usage: SHOW [FirstFile] [SecondFile] [...]
  52. echo.
  53. echo Examples: SHOW c:\*.bat
  54. echo           SHOW tsbat.inf *.pas
  55. echo.
  56.  
  57. rem That was the whole shebang
  58. set _found=
  59. :_out
  60.